/*********************************************************
*Copyright (c) 2009 Rob Groves. All Rights in Pw 
*@des: 管理Client/Session 
*@name: clientmgr.h
*@author: zhongsx
*@time: 2015-03-03
*********************************************************/

#ifndef __CLIENT_MGR_H__
#define __CLIENT_MGR_H__

#include "Global.h"
#include "client.h"
#include <boost/shared_ptr.hpp>
#include <boost/thread/mutex.hpp>

class ClientMgr
{
public:
	ClientMgr();
	virtual ~ClientMgr();

	std::list<boost::shared_ptr<client> > getlist();


	void push(boost::shared_ptr<client>& pClient); //add
	void pop(boost::shared_ptr<client>& pClient);  //pop

	static boost::shared_ptr<ClientMgr>& GetClietMgr();
private:
	static boost::shared_ptr<ClientMgr> pMgr;
	mutable boost::mutex 	mutex_;
	//连接容器
	std::list<boost::shared_ptr<client> > client_list;
};


#endif //__CLIENT_MGR_H__